package com.ai.bitcoin.helper;

import com.ai.bitcoin.constant.QrCodeConstant;
import com.ai.bitcoin.service.helper.WeiXinServiceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

/**
 * @description: ${description}
 * @author: gulj
 * @create: 2018-07-07 17:42
 **/
@Component
public class GetQrcodeUrlHelper {

    @Autowired
    private WeiXinServiceHelper weiXinServiceHelper;

    @Cacheable(value = "getQrCodeUrl")
    public String getQrcodeUrl(String bccId, String openId) {

        String builder = QrCodeConstant.TEMPORY_FIX_QRCODE +
                "_" +
                "coinId" +
                "_" +
                bccId +
                "#" +
                "openId" +
                "_" +
                openId +
                "_";
        return weiXinServiceHelper.generatePermanentQrcode(builder);
    }
}
